package com.pf.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/timeout")
public class TimeOutController {

    @GetMapping("/get")
    public String get(@RequestParam("requestId") String requestId,
                      @RequestParam("accessToken") String accessToken,
                      @RequestParam("userId") Integer userId) {
        log.info(">>>>> get requestId={},accessToken={},userId={}", requestId, accessToken, userId);
        try {
            Thread.sleep(4000);
            return "hello";
        } catch (Exception e) {
            e.printStackTrace();
            return "hello timeout";
        }
    }
}
